//
//  MyCollectionViewCell.m
//  Interface
//
//  Created by Letme on 15-4-14.
//  Copyright (c) 2015年 zhenjiea. All rights reserved.
//

#import "MyCollectionViewCell.h"

@implementation MyCollectionViewCell

- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
{
    self.myImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.contentView.frame.size.width, self.contentView.frame.size.height)];
#warning
    self.myImageView.layer.masksToBounds = YES;
    self.myImageView.layer.cornerRadius = 15;
    [self.contentView addSubview:self.myImageView];
    [_myImageView release];
    
//    self.userImage.layer.cornerRadius = 15;
//    self.userImage.layer.masksToBounds = YES;
    self.nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 120, 100, 30)];
    [self.contentView addSubview:self.nameLabel];
    //label 居左
    self.nameLabel.textAlignment = NSTextAlignmentLeft;
    self.nameLabel.textColor = [UIColor whiteColor];
    
    [_nameLabel release];
   // NSLog(@"自动布局");
}
// set方法 在什么时候会执行
// 给属性赋值时执行
- (void)setModel:(HomePageModel *)model
{
    self.nameLabel.text = model.name;
    NSURL *url = [NSURL URLWithString:model.imageUrl];
    [self.myImageView sd_setImageWithURL:url placeholderImage:[UIImage imageNamed:@"User_Profiles_bg.png"]];
}

@end
